﻿<div id="divProductCompareList">
    <table id="tblProductCompareList" cellpadding="3" cellspacing="0">
        <colgroup>
            <col style="width:60px;" />
            <col />
            <col style="width:30px;" />
        </colgroup>
    @{
        System.Text.StringBuilder sb = new System.Text.StringBuilder(10);            
    }
    @foreach (RH.Web.ViewModels.ProductViewModel product in SessionCache.ProductCompareList)
    {
        sb.Append(sb.Length == 0 ? product.ID.ToString() : String.Format(",{0}", product.ID));
        String productImage = product.ProductImages != null && product.ProductImages.Count > 0 ? product.ProductImages[0].Thumbnail : String.Empty;
        <tr>
            <td>
                <img class="product-img" src="@ImageManager.GetProductImageUrl(productImage, product.ID)" alt="@product.Name" title="@product.Name" />                
                <input type="hidden" name="hdnCompareProductID" value="@product.ID" />
            </td>
            <td><a href="/product/details/@product.ID/@product.ProductUrl" target="_blank">@product.Name</a></td>
            <td><a href="javascript:void(0);" onclick="RemoveFromCompareList(@product.ID, this);">Remove</a></td>                
        </tr>   
    }
    </table>
    <div style="margin:5px 0px 5px 10px;"><a id="aCompareAll" href="/product/compare/@sb.ToString()">Compare All</a></div>
</div>